//
//  AddressCell.m
//  Meum
//
//  Created by 黄卫 on 17/2/27.
//  Copyright © 2017年 huangwei. All rights reserved.
//

#import "AddressCell.h"
@interface AddressCell()

@end
@implementation AddressCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self=[super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        _nameLab = [[UILabel alloc] init];
        _nameLab.frame = CGRectMake(KViewLineSpacing, KViewLineSpacing, 80, 30);
        [self.contentView addSubview:_nameLab];
        
        _phoneNumLab = [[UILabel alloc] init];
        _phoneNumLab.frame = CGRectMake(Screen_Width-100-KViewLineSpacing, KViewLineSpacing, 100, 30);
        [self.contentView addSubview:_phoneNumLab];
        
        _addressLab = [[UILabel alloc] init];
        _addressLab.frame = CGRectMake(KViewLineSpacing, CGRectGetMaxY(_nameLab.frame)+10, 150, 30);
        [self.contentView addSubview:_addressLab];
        
        _deleteBtn = [UIButton buttonWithType:UIButtonTypeCustom];
        _deleteBtn.backgroundColor = [UIColor greenColor];
        _deleteBtn.frame = CGRectMake(Screen_Width-60-KViewLineSpacing, CGRectGetMaxY(_addressLab.frame)+10, 60, 30);
        [_editBtn setTitle:@"删除" forState:UIControlStateNormal];
        [self.contentView addSubview:_deleteBtn];
        
        _editBtn = [UIButton buttonWithType:UIButtonTypeCustom];
        _editBtn.frame = CGRectMake(CGRectGetMinX(_deleteBtn.frame)-KViewLineSpacing-60, CGRectGetMaxY(_addressLab.frame)+10, 60, 30);
        _editBtn.backgroundColor = [UIColor redColor];
        [_editBtn setTitle:@"编辑" forState:UIControlStateNormal];
        [self.contentView addSubview:_editBtn];

     }
    return self;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
